template <class T>
void x_coord(const point& a, const point& vect, T& result)
{
    T a_x(a.x), vect_x(vect.x), a_y(a.y), vect_y(vect.y);

    result = a_x * vect_x + a_y * vect_y;
};

template <class T>
void y_coord(const point& a, const point& vect, T& result)
{
    T a_x(a.x), vect_x(vect.x), a_y(a.y), vect_y(vect.y);

    result = a_y * vect_x - a_x * vect_y;
};